package kr.co.boogui.service;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;

import kr.co.boogui.dao.ShowingDAO;
import kr.co.boogui.model.ShowingVO;

public class ShowingRegistryService {
	
	public static boolean showingRegistry(HttpServletRequest req) throws IOException {
		boolean result = false;
		ShowingVO s = new ShowingVO();
		req.setCharacterEncoding("UTF-8");		
		
		String hinfos[] = req.getParameterValues("hinfo");
		for (int i=0; i<hinfos.length; ++i){
			String infos[] = hinfos[i].split("/");
			s.setMovno(infos[0]);
			s.setCno(infos[1]);
			s.setShdate(infos[2]);
			s.setShtime(infos[3]);
			if (ShowingDAO.insertShowing(s)) result = true;
		}
				
		return result;
	}
	
	
}
//insert into seats values( #{shno}, 'o', 'o', .... , 'o' );